package com.whoiszxl.cqrs.query;

import com.whoiszxl.core.annotation.Query;
import com.whoiszxl.core.entity.PageQuery;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springdoc.api.annotations.ParameterObject;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * 采购订单查询对象
 *
 * @author whoiszxl
 * @date 2021/7/19
 */
@Data
@ParameterObject
@Schema(description = "供应商查询对象")
public class SupplierQuery extends PageQuery {

    @Schema(description = "供应商名称")
    @Query(blurry = "supplier_name")
    private String supplierName;

    @Schema(description = "供应商结算周期")
    @Query
    private Integer accountPeriod;

    @Schema(description = "创建时间区间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Query(type = Query.Type.BETWEEN, property = "created_at")
    private List<Date> createdAt;
}
